﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Studio.Foundation.Json;
using SJTU.SJTURight.Entities;
using Studio.Foundation.Json.Core.Conversion;

public partial class JsonConvert_ImportInterface : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string s = this.TextBox1.Text;

        try
        {
            ResponseEntity<EntitleApplication> result = JsonConvert.Import<ResponseEntity<EntitleApplication>>(s);
            if (null == result) 
                result = new ResponseEntity<EntitleApplication>();

            this.gv1.AutoGenerateColumns = true;
            this.gv1.DataSource = result.entities;
            this.gv1.DataBind();
        }
        catch (Exception ex) 
        {
            System.Diagnostics.Debug.Write(ex);
        }
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        string s = this.TextBox2.Text;
        IDictionary<string, string> dict = JsonConvert.Import<IDictionary<string, string>>(s);
        
    }
}